﻿// --------------------------------
// <copyright file="Form2.cs" company="Samaj Shekhar">
//     Copyright (c) 2010-2011 Samaj Shekhar
// </copyright>
// <author>Samaj Shekhar (samaj.shekhar@hotmail.com)</author>
// <license>Released under the terms of the Microsoft Public License (Ms-PL)</license>
// <website>http://shekhar-pro.blogspot.com</website>
// ---------------------------------

using System;
using System.Drawing;
using System.Windows.Forms;
using SharePage.CoreLib;
using System.Globalization;
using SharePage.CoreLib.Facebook;
using Microsoft.Win32;
using System.Text;
using System.Linq;
using System.Security.Cryptography;
using System.Web.Script.Serialization;
using SharePage.CoreLib.Facebook.GraphAPIObjects;
using SharePage.CoreLib.Utils.ExtentionMethods;

namespace WindowsFormsApplication1
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }

    private void Form2_Load(object sender, EventArgs e)
    {
        JavaScriptSerializer sr = new JavaScriptSerializer();
        System.Net.HttpWebRequest req = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create(@"http://graph.facebook.com/samajshekhar/picture?type=large");
        req.Method = "GET";
        req.GetResponse();
        req.Abort();
        
        //byte[] resp = new byte[(int)res.ContentLength];
        //int bytestoread = 0;
        //for (int i = 0; i < (int)res.ContentLength; )
        //{
        //    bytestoread = (i + 64 < (int)res.ContentLength) ? 64 : 64 - ((i + 64) - (int)res.ContentLength);
        //    i += res.GetResponseStream().Read(resp, i, bytestoread);
        //}
        //string data = Encoding.UTF8.GetString(resp);
        //FacebookFeedsWithAccessToken feed= new FacebookFeedsWithAccessToken();// = sr.Deserialize<FacebookFeedsWithAccessToken>(data);
        //feed.data = new FacebookFeedWithAccessToken[20];
        //string data23=feed.SerializeToJson(true);
        
        //MyClass1 mc = new MyClass1();
        label1.Text = req.Address.ToString();

        
    }
        private void startButton_Click(object sender, EventArgs e)
        {
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
        }

    }

}